﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SWDataDB.BLL;
using SWDataDB.DAL;

using SWDataDB.Models;


public partial class ZKDetails : System.Web.UI.Page
{
    public string strFid=null;
    public int zkflag = 1, bbflag = 1, bpflag = 1, gpflag = 1, ypflag = 1, xgflag = 1, pmflag = 1,utilflag = 1;
    public string fg = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        strFid = Request["fid"];

        fg = Request["fg"];

        

        if (!IsPostBack)
        {
            if (strFid != null)
            {
                bind();
                //strFid = Request["fid"].ToString();

            }
            else
            {
               
                Response.Write("<script lanuage=javascript>alert('没有对应钻孔的信息');location='javascript:history.go(-1)'</script> ");
                bind();
            }
           
        }

    }


    /// <summary>
    /// 绑定数据
    /// </summary>

    public void bind()
    {



        ZLInfo ZKFindbyID = new ZLInfo();
        ZL_TBL zlinfo = ZKFindbyID.SelectZLInfoByID(strFid);

        if (zlinfo != null)
        {
            this.HEAD_TITLE.Text = zlinfo.O_TITLE; 
            this.UNIT.Text = zlinfo.O_UNIT;
            this.PEOJ_NAME.Text = zlinfo.O_PEOJ_NAME;
            this.DATA_CLASS.Text = zlinfo.O_DATA_CLASS;
            this.XZArea.Text = zlinfo.O_ADMIN_REGION;
            this.PUTIN_DATE.Text = zlinfo.O_PUTIN_DATE;
             
             
        }
        else
        {
            this.UNIT.Text = "没有找到相关表信息！";
        }



        //YXInfo zkobj = new YXInfo();
        //GridView1.DataSource = zkobj.SelectInfoByFileID(strFid);
        //GridView1.DataBind();


        ////////////////////////////////////////////////////////////////////////////////////////钻孔
        DataSet ds = new DataSet();
        SWDataDB.DAL.YXInfo ZKobj = new YXInfo();
        ds = ZKobj.SelectInfoByFileID(strFid);
        //ZKGridView.DataKeyNames = new string[] { "ID" };
        
        //DataTable zkdt = ds.Tables[0];
        //DataView zkdv = zkdt.DefaultView;
        ////对用于分页的类的引用
        //PagedDataSource zkpds = new PagedDataSource();
        //zkpds.DataSource = zkdt.DefaultView;//设置数据源(DataTable类型)
        //zkpds.AllowPaging = true;
        //ZKAspNetPager.RecordCount = zkdv.Count;
        //zkpds.CurrentPageIndex = ZKAspNetPager.CurrentPageIndex - 1;
        //zkpds.PageSize = ZKAspNetPager.PageSize;
        //ZKGridView.DataSource = zkpds;
        //ZKGridView.DataBind();
        if (ds.Tables[0].Rows.Count == 0)
        {
            zkflag = 0;
        }
        ////////////////////////////////////////////////////////////////////////////////////////////标本
        DataSet BBds = new DataSet();
        SWDataDB.DAL.BBInfo BBobj = new BBInfo();
        BBds = BBobj.SelectInfoByFileID(strFid);
        
        //BBGridView.DataKeyNames = new string[] { "ID" };
        //DataTable bbdt = BBds.Tables[0];
        //DataView bbdv = bbdt.DefaultView;
        ////对用于分页的类的引用
        //PagedDataSource bbpds = new PagedDataSource();
        //bbpds.DataSource = bbdt.DefaultView;//设置数据源(DataTable类型)
        //bbpds.AllowPaging = true;
        //BBAspNetPager.RecordCount = bbdv.Count;
        //bbpds.CurrentPageIndex = BBAspNetPager.CurrentPageIndex - 1;
        //bbpds.PageSize = BBAspNetPager.PageSize;
        //BBGridView.DataSource = bbpds;
        //BBGridView.DataBind();

        if (BBds.Tables[0].Rows.Count == 0)
        {
            //BBGridView.Attributes.Add("style", "display:block");
            bbflag=0;
        }
        ////////////////////////////////////////////////////////////////////////////////////////////薄片
        DataSet BPds = new DataSet();
        SWDataDB.DAL.BPInfo BPobj = new BPInfo();
        BPds = BPobj.SelectInfoByFileID(strFid);
        
        //BPGridView.DataKeyNames = new string[] { "ID" };


        //DataTable bpdt = BPds.Tables[0];
        //DataView bpdv = bpdt.DefaultView;
        ////对用于分页的类的引用
        //PagedDataSource bppds = new PagedDataSource();
        //bppds.DataSource = bpdt.DefaultView;//设置数据源(DataTable类型)
        //bppds.AllowPaging = true;
        //BPAspNetPager.RecordCount = bpdv.Count;
        //bppds.CurrentPageIndex = BPAspNetPager.CurrentPageIndex - 1;
        //bppds.PageSize = BPAspNetPager.PageSize;
        //BPGridView.DataSource = bppds;
        //BPGridView.DataBind();


        if (BPds.Tables[0].Rows.Count == 0)
        {
            bpflag = 0;
        }
        ////////////////////////////////////////////////////////////////////////////////////////////光片
        DataSet GPds = new DataSet();
        SWDataDB.DAL.GPInfo GPobj = new GPInfo();
        GPds = GPobj.SelectInfoByFileID(strFid);
         
        //GPGridView.DataKeyNames = new string[] { "ID" };


        //DataTable gpdt = GPds.Tables[0];
        //DataView gpdv = gpdt.DefaultView;
        ////对用于分页的类的引用
        //PagedDataSource gppds = new PagedDataSource();
        //gppds.DataSource = gpdt.DefaultView;//设置数据源(DataTable类型)
        //gppds.AllowPaging = true;
        //GPAspNetPager.RecordCount = gpdv.Count;
        //gppds.CurrentPageIndex = GPAspNetPager.CurrentPageIndex - 1;
        //gppds.PageSize = GPAspNetPager.PageSize;
        //GPGridView.DataSource = gppds;
        //GPGridView.DataBind();

        if (GPds.Tables[0].Rows.Count == 0)
        {
            gpflag = 0;
        }
        ////////////////////////////////////////////////////////////////////////////////////////////样品

        DataSet YPds = new DataSet();
        SWDataDB.DAL.YPInfo YPobj = new YPInfo();
        YPds = YPobj.SelectInfoByFileID(strFid);
        
        //YPGridView.DataKeyNames = new string[] { "ID" };

        //DataTable ypdt = YPds.Tables[0];
        //DataView ypdv = ypdt.DefaultView;
        ////对用于分页的类的引用
        //PagedDataSource yppds = new PagedDataSource();
        //yppds.DataSource = ypdt.DefaultView;//设置数据源(DataTable类型)
        //yppds.AllowPaging = true;
        //YPAspNetPager.RecordCount = ypdv.Count;
        //yppds.CurrentPageIndex = YPAspNetPager.CurrentPageIndex - 1;
        //yppds.PageSize = YPAspNetPager.PageSize;
        //YPGridView.DataSource = yppds;
        //YPGridView.DataBind();

        if (YPds.Tables[0].Rows.Count == 0)
        {
            ypflag = 0;
        }
        ////////////////////////////////////////////////////////////////////////////////////////////相关资料
        DataSet XGFds = new DataSet();
        SWDataDB.DAL.XGInfo XGFobj = new XGInfo();
        XGFds = XGFobj.SelectInfoByFileID(strFid);
       
        //XGFGridView.DataKeyNames = new string[] { "ID" };
       
        //DataTable xgdt = XGFds.Tables[0];
        //DataView xgdv = xgdt.DefaultView;
        ////对用于分页的类的引用
        //PagedDataSource xgpds = new PagedDataSource();
        //xgpds.DataSource = xgdt.DefaultView;//设置数据源(DataTable类型)
        //xgpds.AllowPaging = true;
        //XGFAspNetPager.RecordCount = xgdv.Count;
        //xgpds.CurrentPageIndex = XGFAspNetPager.CurrentPageIndex - 1;
        //xgpds.PageSize = XGFAspNetPager.PageSize;
        //XGFGridView.DataSource = xgpds;
        //XGFGridView.DataBind();

        if (XGFds.Tables[0].Rows.Count == 0)
        {
            xgflag = 0;
        }
        ////////////////////////////////////////////////////////////////////////////////////////////剖面

        DataSet PMds = new DataSet();
        SWDataDB.DAL.PMInfo PMobj = new PMInfo();
        PMds = PMobj.SelectInfoByFileID(strFid);
      
        //PMGridView.DataKeyNames = new string[] { "ID" };


        //DataTable pmdt = PMds.Tables[0];
        //DataView pmdv = pmdt.DefaultView;
        ////对用于分页的类的引用
        //PagedDataSource pmpds = new PagedDataSource();
        //pmpds.DataSource = pmdt.DefaultView;//设置数据源(DataTable类型)
        //pmpds.AllowPaging = true;
        //PMAspNetPager.RecordCount = pmdv.Count;
        //pmpds.CurrentPageIndex = PMAspNetPager.CurrentPageIndex - 1;
        //pmpds.PageSize = PMAspNetPager.PageSize;
        //PMGridView.DataSource = pmpds;
        //PMGridView.DataBind();


        if (PMds.Tables[0].Rows.Count == 0)
        {
            pmflag = 0;
        }



        ////////////////////////////////////////////////////////////////////////////////////////////其他实物

        DataSet UTILds = new DataSet();
        SWDataDB.DAL.UTILInfo UTILobj = new UTILInfo();
        UTILds = UTILobj.SelectInfoByFileID(strFid);


        if (UTILds.Tables[0].Rows.Count == 0)
        {
            utilflag = 0;
        }

    }
 



 
 


    //protected void ZKAspNetPager_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    //{
    //    ZKAspNetPager.CurrentPageIndex = e.NewPageIndex;
    //    bind();
    //}
    //protected void BBAspNetPager_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    //{
    //    BBAspNetPager.CurrentPageIndex = e.NewPageIndex;
    //    bind();
    ////}
    //protected void BPAspNetPager_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    //{
    //    BPAspNetPager.CurrentPageIndex = e.NewPageIndex;
    //    bind();
    //}
    //protected void GPAspNetPager_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    //{
    //    GPAspNetPager.CurrentPageIndex = e.NewPageIndex;
    //    bind();
    ////}
    //protected void YPAspNetPager_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    //{
    //    YPAspNetPager.CurrentPageIndex = e.NewPageIndex;
    //    bind();
    ////}
    //protected void PMAspNetPager_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    //{
    //    PMAspNetPager.CurrentPageIndex = e.NewPageIndex;
    //    bind();
    //}
    //protected void XGFAspNetPager_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    //{
    //    XGFAspNetPager.CurrentPageIndex = e.NewPageIndex;
    //    bind();
    //}
}









